package hypeerweb;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * The Class Contents.  Used to store the information contents of a Node.
 * <br/>
 *
 * <b>Domain:</b>
 * 		contents: Map<String, Object>
 * 
 * @author Ryan Hess
 */
public class Contents implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -1025677950384167612L;
	private Map<String, Object> contents = new HashMap<String, Object>();
	
	/**
	 * Default Constructor.  Does nothing.
	 */
	public Contents(){}
	
	/**
	 * Method to determine if this Contents contains the given key.
	 *
	 * @param key the key to check
	 * @return true, if contains key
	 */
	public boolean containsKey(String key)
	{
		return contents.containsKey(key);
	}
	
	/**
	 * Gets the object assocatied with the given key.
	 *
	 * @param key the key to get the object for
	 * @return the object associated with the key
	 */
	public Object get(String key)
	{
		return contents.get(key);
	}
	
	/**
	 * Associates the given key with the given value in the Contents.
	 *
	 * @param key the key with which the specified value is to be associated
	 * @param value the value to be associated with the specified key
	 */
	public void set(String key, Object value)
	{
		contents.put(key, value);
	}
	
    @Override
	public String toString()
	{
		return contents.toString();
	}
}
